package com.ruoyi.lm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lm.mapper.LmUserlevelpackageMapper;
import com.ruoyi.lm.domain.LmUserlevelpackage;
import com.ruoyi.lm.service.ILmUserlevelpackageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户套餐关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-02
 */
@Service
public class LmUserlevelpackageServiceImpl implements ILmUserlevelpackageService 
{
    @Autowired
    private LmUserlevelpackageMapper lmUserlevelpackageMapper;

    /**
     * 查询用户套餐关联
     * 
     * @param id 用户套餐关联ID
     * @return 用户套餐关联
     */
    @Override
    public LmUserlevelpackage selectLmUserlevelpackageById(String id)
    {
        return lmUserlevelpackageMapper.selectLmUserlevelpackageById(id);
    }

    /**
     * 查询用户套餐关联列表
     * 
     * @param lmUserlevelpackage 用户套餐关联
     * @return 用户套餐关联
     */
    @Override
    public List<LmUserlevelpackage> selectLmUserlevelpackageList(LmUserlevelpackage lmUserlevelpackage)
    {
        return lmUserlevelpackageMapper.selectLmUserlevelpackageList(lmUserlevelpackage);
    }

    /**
     * 新增用户套餐关联
     * 
     * @param lmUserlevelpackage 用户套餐关联
     * @return 结果
     */
    @Override
    public int insertLmUserlevelpackage(LmUserlevelpackage lmUserlevelpackage)
    {
        lmUserlevelpackage.setId(IdWorker.getId());
        lmUserlevelpackage.setCreateTime(DateUtils.getNowDate());
        return lmUserlevelpackageMapper.insertLmUserlevelpackage(lmUserlevelpackage);
    }

    /**
     * 修改用户套餐关联
     * 
     * @param lmUserlevelpackage 用户套餐关联
     * @return 结果
     */
    @Override
    public int updateLmUserlevelpackage(LmUserlevelpackage lmUserlevelpackage)
    {
        return lmUserlevelpackageMapper.updateLmUserlevelpackage(lmUserlevelpackage);
    }

    /**
     * 删除用户套餐关联对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLmUserlevelpackageByIds(String ids)
    {
        return lmUserlevelpackageMapper.deleteLmUserlevelpackageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户套餐关联信息
     * 
     * @param id 用户套餐关联ID
     * @return 结果
     */
    @Override
    public int deleteLmUserlevelpackageById(String id)
    {
        return lmUserlevelpackageMapper.deleteLmUserlevelpackageById(id);
    }
}
